package cn.hanna.springcloudalibaba.controller;

import cn.hanna.springcloud.entities.CommonResult;
import cn.hanna.springcloudalibaba.domain.Order;
import cn.hanna.springcloudalibaba.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author smileha
 * @create 2021-10-22 23:30
 * @description
 */
@RestController
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/order/create")
    public CommonResult create(Order order){
        System.out.println("---------------------------");
        orderService.create(order);
        return new CommonResult(200,"订单创建成功",order);
    }
}
